{extend name="wap/b2c/base" /}
{block name="resources"}
<link rel="stylesheet" type="text/css" href="__TEMP__/{$style}/public/css/apply_statu.css">	
<style>
.frog{
	    margin: -10px 20px 20px 20px;
}.apply-p {
    color: #ff5400;
}.apply-money {
    color: #ff5400;
    font-size: 15px;
}
</style>
{/block}
{block name="goodsHead"}
<section class="head">
	<a class="head_back" href="javascript:window.history.go(-1)"><i class="icon-back"></i></a>
	<div class="head-title">股东申请</div>
</section>
{/block}
{block name="main"}
	{if condition="$shop_config['is_partner_enable'] eq 0"}  <!-- 股东功能未开启 -->
	<div id="num3" class="divShow" align="center">
		<div class="frog"><img src="__TEMP__/{$style}/public/images/money_cry.png">股东功能暂未开启，请联系管理人员。</div><br>
	</div>
	{else /}
	<div class="step-process">
		<ul class="clear" id="ul"  style="width: 306px;">
			<li class="step01 current">
				<p class="name ">申请股东</p>
				<span class="number">1</span>
				<span class="prcess-line prcess-line-r"></span>
			</li>
			{if condition="$agent_type eq 2"}  <!-- 待审核 -->  
			<li>
			{else /}
			<li class="current">
			{/if}
				<p class="name">待审核</p>
				<span class="prcess-line prcess-line-l"></span>
				<span class="number">2</span>
				<span class="prcess-line prcess-line-r"></span>
			</li>
			{if condition="$agent_type eq 1"}  <!-- 已通过 -->
			<li class="step03 current">
			{else /}
			<li class="step03">
			{/if}
				<p class="name">申请成功</p>
				<span class="prcess-line prcess-line-l"></span>
				<span class="number">3</span>
			</li>
		</ul>
	</div>
	{if condition="$agent_type eq 2"}  <!-- 没申请过 -->
	<div class="apply">
		<h4>股东协议</h4>
		<hr>
		<p>在成为股东期间，所有股东应该根据总店的政策和决意走。</p>
		<p class="apply-p"><i class="fa fa-info-circle" aria-hidden="true">&nbsp;&nbsp;用户消费金额：<span class="apply-money">{$shop_user_account}元</span></i></p>
		<p class="apply-p"><i class="fa fa-info-circle" aria-hidden="true">&nbsp;&nbsp;最低消费<span>{$shop_sale_money}</span>元，才能申请股东</i></p>
	</div>
	<input  type="hidden" id="hidden_is_meet" value="{$is_meet}" />
	<a href="javascript:applySubmit();" class="a_button">申请</a>
	{elseif condition="$agent_type eq -1"/}  <!-- 拒绝 -->
	<div class="frog">        
	 	 <img src="__TEMP__/{$style}/public/images/agent_apply.png" style="width: 107px;">申请已被拒绝......
	</div>
	<a href="javascript:applySubmit();" class="a_button">重新申请</a>
	{elseif condition="$agent_type eq 0"/}  <!-- 审核中 -->
	<div class="frog"><img src="__TEMP__/{$style}/public/images/agent_apply.png" >申请正在审核中......</div>
<!-- <a href="javascript:location.href='APP_MAIN/member/index?shop_id={$shop_id}'" class="a_button">返回会员中心</a> -->
	<a href="APP_MAIN/distribution/distributionCenter" class="a_button">返回推广中心</a>
	{elseif condition="$agent_type eq 1"/} <!-- 已通过 -->
	<script type="text/javascript">
		location.reload();
		//location.href='APP_MAIN/member/index?shop_id={$shop_id}';
	</script>
	{/if}
{/if}
{/block}
{block name="bottom"}{/block}
{block name="javascript"}
<script type="text/javascript">
	function applySubmit(){
		var hidden_is_meet = $("#hidden_is_meet").val();// 是否满足申请股东最低消费金额
		if(parseInt(hidden_is_meet) ==1){
			$.ajax({
				url:'applyPartner',
				type:'POST', //GET
				async:true,//或false,是否异步
				data:{'shop_id':'{$shop_id}'},
				dataType:'json',//返回的数据格式：json/xml/html/script/jsonp/text
				success:function(retval){
					if(retval['code']>0){
						layer.msg('股东申请成功');
						location.reload();
					}else{
						layer.msg('股东申请失败');
					}
				}
			})
		}else{
			layer.msg("当前您还不满足最低消费，无法申请股东");
		}
	}
</script>
{/block}